/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lnngu_000
 */
@Entity
@Table(name = "StatusOrder")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusOrder.findAll", query = "SELECT s FROM StatusOrder s"),
    @NamedQuery(name = "StatusOrder.findByStatusOrderId", query = "SELECT s FROM StatusOrder s WHERE s.statusOrderId = :statusOrderId"),
    @NamedQuery(name = "StatusOrder.findByName", query = "SELECT s FROM StatusOrder s WHERE s.name = :name"),
    @NamedQuery(name = "StatusOrder.findByIsActive", query = "SELECT s FROM StatusOrder s WHERE s.isActive = :isActive"),
    @NamedQuery(name = "StatusOrder.findByDescriptions", query = "SELECT s FROM StatusOrder s WHERE s.descriptions = :descriptions")})
public class StatusOrder implements Serializable {
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(nullable = false)
    private Integer statusOrderId;
    
    @OneToMany(mappedBy = "statusOrderId")
    private Collection<Orders> ordersCollection;
    private static final long serialVersionUID = 1L;
    
    @Size(max = 100)
    @Column(name = "name")
    private String name;
    @Column(name = "isActive")
    private Boolean isActive;
    @Size(max = 2147483647)
    @Column(name = "descriptions")
    private String descriptions;

    public StatusOrder() {
    }

    public StatusOrder(Integer statusOrderId) {
        this.statusOrderId = statusOrderId;
    }

    public Integer getStatusOrderId() {
        return statusOrderId;
    }

    public void setStatusOrderId(Integer statusOrderId) {
        this.statusOrderId = statusOrderId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getIsActive() {
        return isActive;
    }

    public void setIsActive(Boolean isActive) {
        this.isActive = isActive;
    }

    public String getDescriptions() {
        return descriptions;
    }

    public void setDescriptions(String descriptions) {
        this.descriptions = descriptions;
    }

    @XmlTransient
    public Collection<Orders> getOrdersCollection() {
        return ordersCollection;
    }

    public void setOrdersCollection(Collection<Orders> ordersCollection) {
        this.ordersCollection = ordersCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (statusOrderId != null ? statusOrderId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusOrder)) {
            return false;
        }
        StatusOrder other = (StatusOrder) object;
        if ((this.statusOrderId == null && other.statusOrderId != null) || (this.statusOrderId != null && !this.statusOrderId.equals(other.statusOrderId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.entity.StatusOrder[ statusOrderId=" + statusOrderId + " ]";
    }

    
    
}
